﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Managistics.Model.Mappings
{
    public class AdjustInStockMap : ClassMap<AdjustInStock>
    {

        public AdjustInStockMap()
        {
            Schema(Constants._tblSchema);
            Table(Constants._tblAdjustInStock);
            LazyLoad();

            Id(x => x.Id).GeneratedBy.Identity().Column("Id");

            References(x => x.Good).Column("GoodCode");
            References(x => x.Employee).Column("EmployeeId");

            Map(x => x.AdjustedDate).Column("AdjustedDate").Not.Nullable();
            Map(x => x.GoodPrice).Column("GoodPrice").Not.Nullable().Precision(53);
            Map(x => x.ParityCode).Column("ParityCode").Length(6);
            Map(x => x.ConversionUnit).Column("ConversionUnit").Precision(10);
            Map(x => x.OutputedQuantity).Column("OutputedQuantity").Precision(10);
            Map(x => x.AdjustRetailOutputQuantity).Column("AdjustRetailOutputQuantity").Precision(10);
            Map(x => x.AdjustParityInputQuantity).Column("AdjustParityInputQuantity").Precision(10);
            Map(x => x.Note).Column("Note").Length(2147483647);
            Map(x => x.CreatedDate).Column("CreatedDate").Not.Nullable();
            Map(x => x.UpdatedDate).Column("UpdatedDate").Not.Nullable();
        }
    }
}
